| Visual Basic (Declaration) | |
|---|---|
Public Overloads Sub RegisterCallback( _ ByVal serverDelegate As ServerNotifyDelegate, _ ByVal callback As Action(Of SubscriptionOperation), _ ByVal userToken As Object, _ ByVal ParamArray clientArgs() As Object _ ) | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As EntityManager Dim serverDelegate As ServerNotifyDelegate Dim callback As Action(Of SubscriptionOperation) Dim userToken As Object Dim clientArgs() As Object instance.RegisterCallback(serverDelegate, callback, userToken, clientArgs) | |
| C# | |
|---|---|
public void RegisterCallback( ServerNotifyDelegate serverDelegate, Action<SubscriptionOperation> callback, object userToken, params object[] clientArgs ) | |
| C++/CLI | |
|---|---|
public: void RegisterCallback( ServerNotifyDelegate^ serverDelegate, Action<SubscriptionOperation^>^ callback, Object^ userToken, ... array<Object^>^ clientArgs ) | |
Parameters
- serverDelegate
- Server method providing the "push" service
- callback
- Client method handling pushed data
- userToken
- Token identifying the request
- clientArgs
- Optional arguments which can be passed to service code
| Exception | Description |
|---|---|
| System.InvalidOperationException | Thrown if the serverDelegate is not a static method |
| System.ArgumentNullException | Thrown if the callback action is not provided |
| System.NotSupportedException | Thrown if called from server code |
Use RegisterCallback to register a client for messages or data "pushed" from the server. The serverDelegate indicates the method on the server which performs processing which the client wants to "subscribe" to. The callback indicates the client-side method which will be called whenever the server method pushes data. The userToken should be used to identify the client request. It does not have to be unique acrosss all clients, but it must be unique for all requests from a single client. The clientArgs can be used to pass argument data from the client through to the server. The server code can query for these arguments using the INotificationManager.GetSubscribers method.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family